// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   NamedThreadFactory.java

package org.quickserver.util.pool.thread.app;

import java.util.concurrent.ThreadFactory;

// Referenced classes of package org.quickserver.util.pool.thread.app:
//            QSUncaughtExceptionHandler

public class NamedThreadFactory
    implements ThreadFactory
{

    public NamedThreadFactory(String namePrefix)
    {
        this.namePrefix = namePrefix;
    }

    public Thread newThread(Runnable r)
    {
        Thread t = new Thread(null, r, (new StringBuilder(String.valueOf(namePrefix))).append(++idx).toString());
        t.setUncaughtExceptionHandler(eh);
        return t;
    }

    private static final QSUncaughtExceptionHandler eh = new QSUncaughtExceptionHandler();
    private String namePrefix;
    private int idx;

}
